package com.example.demo27.controller;

/**
 * @Author zhaox
 * @Date 22/3/23
 */
import com.example.demo27.bean.User;
import com.example.demo27.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.Map;


@RestController
public class UserController {
    @Autowired
    UserService userService;


    @RequestMapping("/user/single")
    public User doLogin(User user, Map<String, Object> map, HttpSession session) {
        //从数据库中查询用户信息
        User loginUser = userService.getByUserNameAndPassword(user);
        return loginUser;

    }
}